﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DicTreeSelector.ascx.cs" ClassName="DicTreeSelector" Inherits="Hxsoft.AppV1._Controls.DicTreeSelector" %>
<span id="<%= this.ClientID %>">
<asp:HiddenField ID="CtrSelectorValue" runat="server" />
<asp:LinkButton ID="CtrSelectorPromptText" CausesValidation="false" CssClass="DicTreeSelectorPromptBox" 
	runat="server" onclick="CtrSelectorPromptText_Click"></asp:LinkButton>
<div id="CtrPopupSelector" class="DicTreeSelectorListBox" runat="server">
	<asp:UpdatePanel ID="CtrUpdateList" runat="server">
		<ContentTemplate>
			<asp:TreeView ID="CtrDicTree" runat="server" NodeIndent="10" Visible="false" ShowLines="True" 
				ontreenodepopulate="CtrDicTree_TreeNodePopulate" ExpandDepth="0">
			</asp:TreeView>
		</ContentTemplate>
		<Triggers>
			<asp:AsyncPostBackTrigger ControlID="CtrSelectorPromptText" EventName="Click" />
		</Triggers>
	</asp:UpdatePanel>
</div>
</span>
<script type="text/javascript">
function <%= this.ClientID %>_SelectItem(text, value)
{
	$("#<%= CtrSelectorValue.ClientID %>").val(value);
	$("#<%= CtrSelectorPromptText.ClientID %>").text(text);
	$("#<%= CtrPopupSelector.ClientID %>").css("display", "none");
}

function <%= this.ClientID %>_Init() {
	$("#<%= CtrSelectorPromptText.ClientID %>").popupElement({popupElement : "#<%= CtrPopupSelector.ClientID %>"});
}
</script>